home *** CD-ROM | disk | FTP | other *** search
/ Enciclopedia Del Perro / Enciclopedia Del Perro.iso / info31 / simple3.sc_ / simple3.sc
Text File  |  1994-05-17  |  3KB  |  81 lines

  1. <******************************************************* language=slang
  2.  
  3. Sample SLANG Modem Dialup Script
  4.  
  5. Description:
  6.  
  7.     Simple Example #3 -- Written in the SLANG scripting language
  8.  
  9.     This script dials the modem, enters a user-id after a short
  10.     delay, then a password after another short delay.  Lastly,
  11.     packet mode is enabled so enable TCP/IP data transfers.
  12.  
  13.     This script does not store a user id or password directly,
  14.     but uses the ones that were entered in WDial's Configuration
  15.     Window.
  16.  
  17. To Use This Script:
  18.  
  19.     Change "0000" to the phone number of the remote machine you
  20.     would like to connect to.
  21.  
  22.     Be sure the enter your password and user id in WDial's
  23.     Configuration Window.
  24.  
  25.     Adjust the intervals in the (pause,...) functions to suit
  26.     your needs.  These are in milliseconds (5000 milliseconds ==
  27.     5 seconds).
  28.  
  29.     This script assumes that your modem, and the remote host,
  30.     terminate commands with an ASCII Carrage-Return character.
  31.     If, instead, a Carrage-Return/Line-Feed (CRLF) is required,
  32.     change "(cr)" to "(cr)(lf)" everywhere in the script it is
  33.     necessary.
  34.  
  35. Notes:
  36.  
  37.     This is a very simple dial script.  It assumes that:
  38.  
  39.     o    the modem connection will always be made
  40.  
  41.     o    the remote machine will always be ready for your
  42.         user-id after a set interval
  43.  
  44.     o    like-wise for your password
  45.  
  46.     This script is optimistic and makes no provisions for errors.
  47.     More complex examples provided demonstrate error handling,
  48.     and many other options using features of SLANG.
  49.  
  50. Built-In SLANG Functions Used:
  51.  
  52.     send        Send a character string to the modem.
  53.     cr        Return a Carriage-Return character.
  54.     pause        Wait a specified number of milliseconds.
  55.     username    Return username from WDial's Configuration Window.
  56.     password    Return password from WDial's Configuration Window.
  57.     changemode    Changes mode of connection from "raw" to "packet".
  58.  
  59. ************************************************************************>
  60.  
  61. (send,                <* Dial the remote modem/host        *>
  62.     {ATDT0000}        <*    Modem command and phone number    *>
  63.     (cr)            <*    Carrage-Return after modem cmd    *>
  64. )                <*    End of "send" function        *>
  65. (pause, 30000)            <* Wait for the modem to connect    *>
  66. (send,                <* Log-in to the remote modem/host    *>
  67.     (username)        <*    Send your user id        *>
  68. )
  69. (send,
  70.     (cr)            <*    Carriage-Return after user id    *>
  71. )                <*    End of "send" function        *>
  72. (pause, 5000)            <* Wait for a password prompt        *>
  73. (send,                <* Send the password            *>
  74.     (password)        <*    Send password            *>
  75. )
  76. (send,
  77.     (cr)            <*    Carriage-Return after password    *>
  78. )                <*    End of "send" function        *>
  79. (pause, 5000)            <* Pause for a moment            *>
  80. (changemode, packet)        <* Change to "packet" mode        *>
  81.